package indi.zhifa.study2024.consigntest.gen.busy.define.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import indi.zhifa.core.mpenhance.entity.annotations.ZfDbService;
import indi.zhifa.study2024.consigntest.gen.busy.define.po.GenItemEntity;
import indi.zhifa.study2024.consigntest.gen.busy.define.mapper.GenItemMapper;
import indi.zhifa.study2024.consigntest.gen.busy.define.service.IGenItemDbService;
import indi.zhifa.core.mpenhance.service.impl.ZfDbServiceImpl;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 织法
 * @since 2024-12-14
 */
@ZfDbService(name="GenItemEntity")
public class GenItemDbServiceImpl extends ZfDbServiceImpl<GenItemMapper, GenItemEntity> implements IGenItemDbService {

    @Override
    public void clearTest() {
        LambdaUpdateWrapper<GenItemEntity> updateWrapper = new LambdaUpdateWrapper<GenItemEntity>()
                .eq(GenItemEntity::getTestData,true);
        remove(updateWrapper);
    }

    @Override
    public List<GenItemEntity> listByEnpId(Long pEnpId) {
        LambdaQueryWrapper queryWrapper = Wrappers.<GenItemEntity>lambdaQuery()
                .eq(GenItemEntity::getTestData,true)
                .eq(GenItemEntity::getEnpId,pEnpId);
        return list(queryWrapper);
    }
}
